@use '@scss/common' as *;

.tabsContainer {
  position: relative;
  width: 100%;
  margin-bottom: calc(var(--base) * 2);
  border-bottom: 1px solid var(--theme-border-color);

  @include mid-break {
    margin-bottom: 1.5rem;
  }
}

.tabs .tab {
  background-color: transparent;
  border-radius: none;
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
  margin: 0;
  margin-right: 1.5rem;
  padding-bottom: 1.5rem;
  position: relative;
  color: var(--theme-elevation-600);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;

  &.lastTab {
    margin-right: 0;
  }

  &:not(:disabled):after,
  &.active:after {
    // text underline
    content: '';
    position: absolute;
    width: 100%;
    left: 0;
    bottom: 0;
    height: 2px;
    background-color: currentColor;
    opacity: 0;
    z-index: 1;
  }

  &:hover::after,
  &.active::after,
  &:focus-within::after {
    // text underline
    opacity: 1;
  }

  &.active {
    color: var(--theme-text);

    &.warning {
      color: var(--theme-warning-500);
    }

    &.error {
      color: var(--theme-error-650);
    }
  }

  &.warning {
    color: var(--theme-warning-300);
  }

  &.error {
    color: var(--theme-error-600);
  }

  &:disabled {
    color: var(--theme-elevation-20);
    cursor: not-allowed;
  }
}

.iconWrapper {
  position: relative;
  top: 2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
}

.tabsContainer {
  @include mid-break {
    .tab {
      padding-bottom: 1rem;
    }
  }
}
